package 工厂模式.简单工厂.service.factory;

import 工厂模式.简单工厂.service.IFreeGoods;
import 工厂模式.简单工厂.service.impl.DiscountFreeGoods;
import 工厂模式.简单工厂.service.impl.SmallGiftFreeGoods;
import 工厂模式.简单工厂.service.impl.YouKuMemberFreeGoods;

/**
 * 具体工厂
 */
public class FreeGoodsFactory {
    public static IFreeGoods getInstance(Integer awardType) {
        IFreeGoods freeGoods = null;
        if (awardType == 1) {
            freeGoods =  new DiscountFreeGoods();
        } else if (awardType == 2) {
            freeGoods =  new SmallGiftFreeGoods();
        } else if (awardType == 3) {
            freeGoods = new YouKuMemberFreeGoods();
        }
        return freeGoods;
    }
}
